package org.smileface.designpattern.prototype;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * @description: 人
 * @author: chujian
 * @since: 2022-02-19 16:22
 **/
@Getter
@Setter
@Accessors(chain = true)
@ToString
public class PrototypePerson implements Cloneable, Serializable {
    private String id;
    private String name;
    private Integer age;
    private List<String> hobbies;

    @Override
    public PrototypePerson clone() {
        try {
            return (PrototypePerson) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

}
